mui('.mui-scroll-wrapper').scroll({	
	indicators: false
});

//封装全局获取传入参数的方法
window.lt = {};
lt.getUrlParams = function(){
	// 存储url的参数
	var obj = {};
	//获取参数
	var search = location.search;
	if(search.indexOf('?')==0){
		//去除问号，判断是否是第一个
		search = search.substr(1);
		//分割成数组
		var arr = search.split('&');
		arr.forEach(function(item,index){
			var key = item.split('=')[0];
			var value = item.split('=')[1];
			obj[key] = value;
		})
	}
	return obj;
}


// 登录拦截
lt.loginFilter = function(option){
	$.ajax({
		type:option.type || 'get',
		data:option.data || {},
		url:option.url || location.pathname,
		dataType:option.dataType || 'json',
		beforeSend:function(){
			option.beforeSend && option.beforeSend()
		},
		success:function(data){
			// 如果未登录状态，跳转到登录页 erroe为400
			if(data.error==400){
				location.href = '/m/user/login.html?returnUrl='+location.href
			}else{
				option.success && option.success(data)
			}
		},
		error:function(){
			option.error && option.error()
		}
	})
}
